import pickle as pk

data = pk.load(open("trace_data_all_ida.pkl", "rb"))

atom = set()
for k in data:
    if "Conv2D" in k or "LSTM" in k:
        continue

    for funcname in data[k]:
        name = funcname
        if 'fused_' in name:
            name = name.replace('fused_', '')
        if '_compute_' in name:
            name = name.replace('_compute_', '')
        if 'tvmgen_default_' in name:
            name = name.replace('tvmgen_default_', '')
        if 'nn_' in name:
            name = name.replace('nn_', '')

        if name.split('_')[-1].isdigit():
            name = name[:-(len(name.split('_')[-1]) + 1)]
        atom.add(name)
        if name == 'minimum':
            #             print(data[k].keys())
            print(k)
            for func_k in data[k]:
                if "minimum" in func_k:
                    print(data[k][func_k]["blocks"])
            break
    if name == "minimum":
        break
